package entity

/**
* @author aFun
* @data 2025/4/10 01:01
* @email: afunaaa222@163.com / 1030935903
* @address: Guangdong University of Technology, China
 */

import (
	"database/sql/driver"
	"encoding/json"
	"fmt"
)

type Item struct {
	Id   int64
	Num  int64
	Name string
}

type ItemList []Item

func (items ItemList) Value() (driver.Value, error) {
	return json.Marshal(items)
}

func (item *ItemList) Scan(src interface{}) error {
	return json.Unmarshal(src.([]byte), item)
}

func (item *Item) String() string {
	return fmt.Sprintf("Item<%d,%d,%s>", item.Id, item.Num, item.Name)
}

type Client_floor_reward struct {
	Floor       int8
	Pos         int8
	ItemName    string
	Quantity    int64
	MaxQuantity int64
}

type Client_cumulative_reward struct {
	TokenCost int64
	ItemName  string
	Quantity  int64
}

type ItemForQueue struct {
	Role_id uint
	Id      int64
	Num     int64
	Name    string
}
